import request from "@/utils/axiosHttp";

// 登录方法
export function login(account, password) {
	const data = {
		account,
		password,
	}
	return request({
		url: '/deviceUsers/login',
		headers: {
			isToken: false,
			repeatSubmit: false
		},
		method: 'post',
		data: data
	})
}

//注册
export function register(data) {
	return request({
		url: '/deviceUsers/register',
		headers: {
			isToken: false,
			repeatSubmit: false
		},
		method: 'post',
		data: data
	})
}


// 获取用户详细信息
export function getInfo() {
	return request({
		url: '/getInfo',
		method: 'get'
	})
}

// 用户信息
export function getuserInfo(query) {
	return request({
		url: '/deviceUsers/userInfo',
		method: 'get',
		params: query
	})
}

// 退出方法
export function logout() {
	return request({
		url: '/logout',
		method: 'post'
	})
}

// 获取验证码
export function sendVerification(data) {
	return request({
		url: '/deviceUsers/sendVerification',
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data,
		timeout: 20000
	})
}


// 忘记密码
export function resetPassword(data) {
	return request({
		url: '/deviceUsers/resetPassword',
		method: 'post',
		headers: {
			isToken: false,
			repeatSubmit: false
		},
		data: data
	})
}


// 修改密码
export function updatePassword(data) {
	return request({
		url: '/deviceUsers/updatePassword',
		method: 'post',
		data: data
	})
}